//抽离路由从mian.js
import VueRouter from "vue-router";

//导入对应路由组件
import HomeContainter from "./components/tabbar/HomeContainter.vue";
import MemberContainter from "./components/tabbar/MemberContainter.vue";
import ShopcarContainter from "./components/tabbar/ShopcarContainter.vue";
import SearchContainter from "./components/tabbar/SearchContainter.vue";
import Newslist from "./components/news/Newslist.vue";
import Newsinfo from './components/news/Newsinfo.vue';
import Photolist from './components/photos/Photolist.vue';
import Photoinfo from './components/photos/Photoinfo.vue';
import Goodslist from './components/goods/Goodslist.vue';
import Goodsinfo from './components/goods/Goodsinfo.vue';
import Goodsdesc from './components/goods/Goodsdesc.vue';
import Goodscomment from './components/goods/Goodscomment.vue';

//3.创建路有对象
var router = new VueRouter({
  routes: [ 
    {path:'/',redirect:'/home'},
    {path:'/home', component:HomeContainter},
    {path:'/member', component:MemberContainter},
    {path:'/shopcar', component:ShopcarContainter},
    {path:'/search', component:SearchContainter},
    {path:'/home/newslist', component:Newslist},
    {path:'/home/newsinfo/:id',component:Newsinfo},
    {path:'/home/photolist',component:Photolist},
    {path:'/home/photoinfo/:id',component:Photoinfo},
    {path:'/home/goodslist',component:Goodslist},
    {path:'/home/goodsinfo/:id',component:Goodsinfo,name:'goodsinfo'},
    {path:'/home/goodsdesc/:id',component:Goodsdesc,name:'goodsdesc'},
    {path:'/home/goodscomment/:id',component:Goodscomment,name:'goodscomment'}
  ],
  linkActiveClass: 'mui-active' //覆盖默认路由高亮类
});

export default router; //暴露第3步中的router
